<template>
  <div>
    <Edit
      title="Favorites list"
      :edit="true"
      :progress="true"
      :updataArr="favoritesList"
      :conutNum="conutNum"
      @handleSizeChange="handleSizeChange"
    />
  </div>
</template>

<script>
import Edit from "../../components/HistoryChild/Edit.vue";
import { BookshelfsApi } from "../../requery/api";
export default {
  data() {
    return {
      favoritesList: [], //收藏书架
      conutNum: null,
    };
  },
  methods: {
    handleSizeChange(val) {
      BookshelfsApi({
        page: val,
        size: 12,
      }).then((res) => {
        if (res.code == 200) {
          this.favoritesList = res.data;
          this.conutNum = res.count;
        }
        console.log(res);
      });
    },
  },
  created() {
    BookshelfsApi({
      page: 1,
      size: 12,
    }).then((res) => {
      if (res.code == 200) {
        this.favoritesList = res.data;
        this.conutNum = res.count;
      }
      console.log(res);
    });
  },
  components: {
    Edit,
  },
};
</script>
 
<style lang = "less" scoped>
</style>